<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>用户授权</title>
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
<div v-cloak id="app">
  <el-card style="max-width: 50rem;margin: auto;">
    <h3 slot="header">
      <p>
        授予<span th:text="${authorizationRequest.redirectUri}"></span>对<span
          th:text="${authorizationRequest.clientId}"></span>的访问权限
      </p>
      <p>
        权限范围：<span th:text="${authorizationRequest.scope}"></span>
      </p>
    </h3>
    <el-form action="/oauth/authorize" method="post">
      <el-form-item>
        <input th:each="scope:${authorizationRequest.scope}" type="hidden"
               th:name="'scope.'+${scope}" value="true"/>
        <input name="user_oauth_approval" value="true" type="hidden"/>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" native-type="submit">
          授权
        </el-button>
      </el-form-item>
    </el-form>
  </el-card>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
  new Vue({
    el: '#app',
    data: function () {
      return {visible: false}
    }
  })
</script>
</html>